home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 168 / 168.d81 / index source < prev    next >
Text File  |  2022-08-26  |  1KB  |  143 lines

  1. open =$ffc0
  2. readst =$ffb7
  3. setlfs =$ffba
  4. setnam =$ffbd
  5. load =$ffd5
  6. getin =$ffe4
  7. clrchn =$ffcc
  8. close =$ffc3   ;a
  9. chrin =$ffcf
  10. chkout =$ffc9  ;x
  11. chkin =$ffc6   ;x
  12. plot =$fff0
  13. chrout =$ffd2
  14. color'pointer =243
  15. screen'line'pointer =209
  16. print'number =$bdcd ;x,a
  17. clear'line =59903
  18. background =53281
  19. border =53280
  20. unlisten =$ffae
  21. clall =$ffe7
  22. location =251
  23. index =253
  24. count =249
  25.  
  26.  
  27. .org $c000
  28. .mem
  29. .obj "@0:indexer c000"
  30.  
  31.  
  32. jsr get'number
  33. sty location
  34. sta location+1
  35.  
  36. jsr get'number
  37. sty index
  38. sta index+1
  39.  
  40. jsr rom'out
  41.  
  42. lda #0
  43. sta count
  44. sta count+1
  45. sta length
  46.  
  47. lda index
  48. ora index+1
  49. cmp #0
  50. beq found
  51.  
  52. ldy #0
  53. - lda (location),y
  54. beq end'of'file
  55.  
  56. inc location
  57. bne +
  58. inc location+1
  59.  
  60. + cmp #13
  61. beq bump'count
  62. jmp -
  63.  
  64. bump'count inc count
  65. bne +
  66. inc count+1
  67.  
  68. + lda count+1
  69. cmp index+1
  70. bcc -
  71. lda count
  72. cmp index
  73. bcc -
  74.  
  75. found ldy #0
  76. - lda (location),y
  77. cmp #13
  78. beq +
  79. inc length
  80. sta string,y
  81. iny
  82. bne -
  83.  
  84. / jsr rom'in
  85. ldx <string'name
  86. ldy >string'name
  87. jsr locvar
  88. lda <length
  89. ldy >length
  90. jmp set'string
  91.  
  92. end'of'file lda #0
  93. sta length ;in order to return null
  94. jmp -
  95.  
  96.  
  97. get'number jsr $aefd
  98. jsr $ad8a
  99. jmp $b7f7
  100.  
  101. rom'out pha
  102. sei
  103. lda #$74
  104. sta 1
  105. pla
  106. rts
  107.  
  108. rom'in pha
  109. lda #$77
  110. sta 1
  111. cli
  112. pla
  113. rts
  114. ;x and y point to string name
  115.  
  116. locvar lda $7a
  117. pha
  118. lda $7b
  119. pha
  120. stx $7a
  121. sty $7b
  122. jsr $b08b
  123. sta $49
  124. sty $4a
  125. pla
  126. sta $7b
  127. pla
  128. sta $7a
  129. rts
  130.  
  131. set'string sta $64
  132. sty $65
  133. jmp $aa52
  134.  
  135. string'name .asc "w$":.byt 0
  136. length .byt 0
  137. .word string 
  138. string .buf 40
  139.  
  140.  
  141.  
  142.  
  143.